<style>
    .form-group .col-sm-2{
        max-width: 120px;
    }
    .form-control{ height: 31px}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


    <div class="row content">


        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseOne">
                            <span>{:__('客户资料')}</span> <small>(编号:{$row.customer_id})</small>
                        </a>
                        <span class="label label-primary bg-red pull-right">
                            <a href="javascript:parent.Fast.api.open('facrm/customer/index/detail/ids/{$row.customer_id}',__('客户详情-'));" style="color: #fff;"> 详情</a></span>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="col-md-6 col-xs-12 form-group">
                            <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('客户')}：</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index/selectpage/type/all"
                                       class="form-control selectpage" name="row[customer_id]" type="text" value="{$row.customer_id}" disabled>

                            </div>
                        </div>
                        <div class="col-md-6 col-xs-12 form-group business_id_div" >
                            <label for="c-business_id" class="control-label col-xs-12 col-sm-2">{:__('商机')}：</label>
                            <div class="col-xs-12 col-sm-8">


                                <input id="c-business_id" data-rule="required" data-source="facrm/business/index/index"
                                       class="form-control selectpage" name="" type="text" value="{$row.business_id}"  disabled>

                            </div>
                        </div>


                        <div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('手机')}：</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-mobile" type="text" data-rule="required" class="form-control" name="row[mobile]" value="{$row.customer.mobile}" disabled />
                            </div>
                        </div>

                        <div class="col-md-6 col-xs-12 form-group ">
                            <label for="c-address" class="control-label col-xs-12 col-sm-2">客户地址：</label>
                            <div class="col-xs-12 col-sm-8">
                                <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area" id="c-address">
                                    <select class="province form-control" name="province" data-url="ajax/area" disabled>
                                        <option value="{$row.customer.province}" selected=""></option>
                                    </select>
                                    <select class="city form-control" name="city" data-url="ajax/area" disabled>
                                        <option value="{$row.customer.city}" selected=""></option>
                                    </select>
                                    <select class="area form-control" name="area" data-url="ajax/area" disabled>
                                        <option value="{$row.customer.area}" selected=""></option>
                                    </select>


                                </div>
                            </div>
                        </div>


                        <div class="col-md-6 col-xs-12  form-group ">
                            <label for="c-address" class="control-label ol-xs-12 col-sm-2">详细地址：</label>
                            <div class="col-xs-6 col-sm-8">

                                <input id="c-detail_address" type="text" data-rule="required" class="form-control" name="row[detail_address]"
                                       value="{$row.customer.detail_address}" disabled  />


                            </div>
                        </div>

                    </div>
                </div>
            </div>


            <div class="panel panel-warning">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseFour">
                            <span>{:__('合同编号')}：</span><small>{$row.number}</small>
                            <span style="margin-left: 30px;">{:__('下单日期')}：</span><small>{$row.order_time|datetime}</small>
                        </a>
                    </h4>
                </div>
                <div id="collapseFour" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="col-md-12 col-xs-12 form-group">
                            <label for="c-deposit_money" class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-10">
                                <p></p>
                            </div>
                        </div>

                        <div class="col-md-6 col-xs-12 form-group">
                            <label  class="control-label col-xs-12 col-sm-2">{:__('回款金额')}:</label>
                            <div class="col-xs-12 col-sm-8 ">
                                <label class="control-label">￥{$row.return_money}（{:__('已开票')}：{$row.invoice_money}）</label>

                            </div>
                        </div>

                        <div class="col-md-6 col-xs-12 form-group">
                            <label for="c-start_time" class="control-label col-xs-12 col-sm-2">{:__('合同始止日期')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <label class="control-label">{$row.start_time|date='Y-m-d H:i',###} ~ {$row.end_time|date='Y-m-d H:i',###}</label>

                            </div>
                        </div>


                        <div class="col-md-6 col-xs-12 form-group">
                            <label for="c-order_admin_id" class="control-label col-xs-12 col-sm-2">{:__('销售人员')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <label class="control-label">{$row.order_admin.nickname}</label>
                            </div>
                        </div>




                        <div class="col-md-6 col-xs-12 form-group">
                            <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <label class="control-label">{$row.remark}</label>
                            </div>
                        </div>



                        <div class="">
                            <div class="col-md-12 col-xs-12 form-group">

                                <div class="col-xs-12 col-sm-12">
                                    <div class="table-responsive" >
                                        <table id="table" class="table table-striped table-bordered table-hover table-nowrap">
                                            <thead>
                                            <th>{:__('序号')}</th>
                                            <th>{:__('编码')}</th>
                                            <th style="width: 100px">{:__('商品')}</th>
                                            <th>{:__('规格')}</th>
                                            <th>{:__('属性')}</th>
                                            <th >{:__('单位')}</th>
                                            <th style="width: 80px">{:__('数量')}</th>
                                            <th style="width: 80px">{:__('售价')}</th>
                                            <th>{:__('小计')}</th>
                                            <th>{:__('备注')}</th>

                                            </thead>
                                            <tbody>

                                            {foreach name="$row.product" item="vo"  index="i" }
                                            <tr>
                                                <td>{$i}</td>
                                                <td>{$vo.info.sku}</td>
                                                <td>
                                                    <input date-rule="required;" style="width: 100px" value="{$vo.info.name}"  type="text" name="product[{$i}][name]" data-index="{$i}" class="find" class="" data-toggle="modal" data-target="#modelProduct" disabled >
                                                </td>
                                                <td class="gg">{$vo.specification}</td>
                                                <td>
                                                    {$vo.prop}
                                                </td>
                                                <td class="unit">{$vo.unit}</td>
                                                <td>
                                                    {$vo.nums}
                                                </td>
                                                <td>
                                                    {$vo.sales_price}/<span style="text-decoration: line-through;">{$vo.price}</span>
                                                </td>
                                                <td class="subtotal">
                                                    {$vo.subtotal}
                                                </td>
                                                <td> {$vo.remarks}</td>
                                            </tr>
                                            {/foreach}

                                            </tbody>
                                        </table>
                                    </div>
                                    <div>

                                        <div class="row">
                                            <div class="col-md-4 col-xs-6">
                                                <label class="control-label col-xs-12 col-sm-6">{:__('优惠率%')}:</label>
                                                <div class="col-xs-12 col-sm-6">
                                                    <label class="control-label "> {$row.discount_rate}</label>
                                                </div>
                                            </div>
                                            <div class="col-md-4 col-xs-6">
                                                <label class="control-label col-xs-12 col-sm-6"> {:__('总额￥')}:</label>
                                                <div class="col-xs-12 col-sm-6">
                                                    <label class="control-label "> {$row.total_price}</label>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


                    </div>


                </div>



            </div>

            <div class="panel panel-info">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseThree">
                           合同扩展
                        </a>
                    </h4>
                </div>
                <div id="collapseThree" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div id="extend"></div>

                    </div>
                </div>
            </div>


            <div class="panel panel-success">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapsepay">
                            付款信息
                        </a>
                    </h4>
                </div>
                <div id="collapsepay" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="col-md-12 col-xs-12 form-group">
                            <div class="col-xs-12 col-sm-12">
                                <div class="table-responsive">
                                    <table id="tablepay" class="table table-striped table-bordered table-hover table-nowrap">
                                        <thead>
                                        <th>{:__('ID')}</th>
                                        <th>{:__('编号')}</th>
                                        <th>{:__('金额')}</th>
                                        <th>{:__('时间')}</th>
                                        <th>{:__('备注')}</th>
                                        <th>{:__('状态')}</th>
                                        </thead>
                                        <tbody>
                                        {foreach name="$row.receivables" item="v"  index="j" }
                                        <tr>
                                            <td>{$v.id}</td>
                                            <td>
                                                {$v.number}
                                            </td>
                                            <td>
                                                {$v.money}
                                            </td>
                                            <td>
                                                {$v.return_time|datetime}
                                            </td>
                                            <td>
                                                {$v.remark}
                                            </td>
                                            <td>
                                                {$v.check_status_text}
                                            </td>
                                        </tr>
                                        {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapse5">
                            {:__('审核日志')}
                        </a>
                    </h4>
                </div>
                <div id="collapse5" class="panel-collapse collapse ">
                    <div class="panel-body">
                        <div class="col-md-12 col-xs-12 form-group">
                            <div class="col-xs-12 col-sm-12">
                                <div class="table-responsive">
                                    <table id="table11" class="table table-striped table-bordered table-hover table-nowrap">
                                        <thead>
                                        <th>{:__('顺序')}</th>
                                        <th>{:__('审核人')}</th>
                                        <th>{:__('意见')}</th>
                                        <th>{:__('状态')}</th>
                                        <th>{:__('时间')}</th>
                                        </thead>
                                        <tbody>
                                        {foreach name="row.flow_log" item="v"  index="j" }
                                        <tr>
                                            <td>{$j}</td>
                                            <td>
                                                {$v.nickname}({$v.admin_id})
                                            </td>
                                            <td>
                                                {$v.remark}{$v.is_end==1?"（审核结束）":""}
                                            </td>
                                            <td>
                                                {$v.status==1?"通过":"未通过"}
                                            </td>
                                            <td>
                                                {$v.create_time|datetime}
                                            </td>
                                        </tr>
                                        {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            {if($auth->check('facrm/operatelog/index'))}
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseseven1">
                            操作记录
                        </a>
                    </h4>
                </div>
                <div id="collapseseven1" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <table id="operatelog" class="table table-striped table-bordered table-hover table-nowrap"
                               width="100%">
                        </table>

                    </div>
                </div>
            </div>
            {/if}



        </div>
    </div>




</form>
<script>
    var contract_id={:input('ids')};
    var types="{:input('types')}";
</script>


